/**
 * VUEshop
 * ============================================================================
 * * 版权所有 2015-2027 深圳搜豹网络科技有限公司，并保留所有权利。
 * 网站地址: http://www.vueshop.com.cn
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件！您只能在不用于商业目的的前提下对程序代码进行修改和使用 .
 * 不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
 * $Author: 沈小白 2020-07-22 $
 */<template> 
		<!-- 虚拟订单 -->
		<view class="container">
			<view class="type-navbar">
				<block v-for="(item,index) in navList" :key="index">
					<view class="type-box">
						<view @tap="changeTab" class=" type-navbar-item " :class="[typeActive==item.id?'type-item-on':'']" :data-id="item.id" :data-type="item.type">
							{{item.name}}
						</view>
					</view>
				</block>
			</view>
			<view class="goods-container" >
				<view class="goods-box" data-id="undefined" >
					<view class="goods-title">
						<view class="store-name">
							<image class="store-logo" :src="imgUrl+'cart/carnew.png'" role="img"></image>
							邮汇·派
						</view>
						<view class="pay-status">待收货</view>
					</view>
					<view class="order-number">订单编号:201912040930568447</view>
					<view class="goods-cont">
						<navigator class="img-box" url="/pages/user/order_detail/order_detail?order_id=4893" role="navigation">
							<image class="wh100" src="http://192.168.0.250:1002/api/goods/goodsThumImages?goods_id=2958&width=200&height=200"
							 role="img"></image>
						</navigator>
						<navigator class="goods-mes" url="/pages/user/order_detail/order_detail?order_id=4893" role="navigation">
							<view class="goods-name">123啊啊啊</view>
							<view class="goods-name"></view>
							<view class="goods-price">¥ 108.00</view>
							<view class="goods-num">数量 1</view>
						</navigator>
					</view>
					<view class="goods-tips">
						<view class="order-total">
							<view class="goods-total">￥0.00</view>
							共1件
						</view>
						<view class="check-btn">
							<view @tap="confirmOrder" class="order-btn" data-id="4893">确认收货</view>
						</view>
					</view>
				</view>
				
			</view>
			<no-data2 :hide="ishide"></no-data2>
		</view>
	
</template>

<script>
	import NoData2 from "@/components/nodata2/nodata2.vue";
	import {getOrderPage} from "@/api/api.js";
	import config from "@/api/config.js";
	export default {
		data() {
			return {
				hostUrl:config.host,
				imgUrl:config.imgUrl,
				loginInfo:"",
				ishide:false,//无数据 默认隐藏
				navList:[
					{name:"全部订单",id:0,type:""},
					{name:"待付款",id:1,type:"WAITPAY"},
					{name:"待发货",id:2,type:"WAITSEND"},
					{name:"待收货",id:3,type:"WAITRECEIVE"},
					{name:"已完成",id:4,type:"FINISH"},
				],
				typeActive:0,//状态
				params:{
					size:10,//大小10条
					prom_type:"",//订单类型 6为拼团订单 虚拟订单暂无
					type:"",//默认全部订单
				}
			};
		},
		components:{
			NoData2
		},
		onShow(){
			let loginInfo=uni.getStorageSync('loginInfo') ||null//登录信息
			this.loginInfo=loginInfo
			if(loginInfo!=null){
				this.getOrderPage(this.params)
			}else{
				common.toast("none","请登录",2000)
				
			}
		},
		methods:{
			//订单
			getOrderPage(params){
				getOrderPage(params).then(res=>{
					console.log(res)
					if(res){
						this.goodsDateil=res.records
						this.total=res.total
					}
				})
			},
		}
	}
</script>

<style lang="scss">
	.type-navbar {
		white-space: nowrap;
		display: flex;
		width: 100%;
		height: 80rpx;
		background-color: #fff;
	}

	.type-box {
		width: 25%;
		box-sizing: border-box;
		font-size: 28rpx;
		line-height: 76rpx;
		padding: 0 20rpx;
		text-align: center;
		display: inline-block;
		overflow: hidden;
	}

	.type-navbar-item {
		border-bottom: 4rpx solid #fff;
	}

	.type-item-on {
		border-bottom: 4rpx solid #ff3b3b;
	}

	.goods-container {
		display: flex;
		justify-content: space-between;
		flex-wrap: wrap;
		box-sizing: content-box;
		padding: 20rpx 0;
	}

	.goods-box {
		background-color: #fff;
		padding: 0 30rpx;
		margin: 0 auto;
		margin-bottom: 20rpx;
		font-size: 28rpx;
		width: 710rpx;
		border-radius: 10rpx;
		overflow: hidden;
		box-sizing: border-box;
	}

	.goods-title {
		display: flex;
		justify-content: space-between;
		align-items: center;
		height: 100rpx;
	}

	.store-logo {
		height: 30rpx;
		width: 30rpx;
		border-radius: 25%;
		margin-right: 10rpx;
		vertical-align: top;
	}

	.store-name {
		color: #666;
		font-size: 30rpx;
	}

	.order-number {
		font-size: 24rpx;
		color: #666;
		margin: 30rpx 0;
	}

	.pay-status {
		color: #ff3b3b;
	}

	.goods-cont {
		padding: 20rpx 0;
		display: flex;
		justify-content: space-between;
		position: relative;
	}

	.img-box {
		width: 180rpx;
		height: 180rpx;
	}

	.goods-mes {
		width: 450rpx;
	}

	.goods-name {
		height: 30rpx;
		margin-bottom: 16rpx;
		overflow: hidden;
		line-height: 30rpx;
		color: #333;
		word-break: keep-all;
		white-space: nowrap;
		text-overflow: ellipsis;
	}

	.goods-price {
		color: #ff3b3b;
		padding-bottom: 20rpx;
	}

	.goods-num {
		color: #999999;
		font-size: 26rpx;
	}

	.return-btn {
		color: #999999;
		position: absolute;
		right: 0;
		bottom: 0rpx;
		height: 80rpx;
		line-height: 80rpx;
	}

	.goods-tips {
		height: 60rpx;
		padding: 50rpx 0;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.order-total {
		display: flex;
		justify-content: flex-start;
		font-size: 24rpx;
		color: #333;
	}

	.goods-total {
		margin-right: 20rpx;
		color: #ff3b3b;
	}

	.order-btn {
		width: 150rpx;
		height: 60rpx;
		line-height: 60rpx;
		text-align: center;
		border: 1px solid #f3f3f3;
		margin-left: 20rpx;
		float: right;
		border-radius: 5rpx;
	}

	.order-btn-pay {
		color: #fff;
		background-color: #ff3b3b;
		border-color: #ff3b3b;
	}
</style>
